package nc.vo.ic.general.define;

import java.util.ArrayList;
import java.util.List;
import nc.vo.ic.location.ICLocationVO;
import nc.vo.ic.pub.util.CollectionUtils;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;






public abstract class ICBillVO
  extends AbstractBill
  implements ICBillEntity
{
  private static final long serialVersionUID = 5518090599517587040L;
  private boolean hasLoadedLocations = false;
  private String pk_billtemp;
  
  public ICBillBodyVO getBody(int row) { return getChildrenVO()[row]; }



  
  public ICBillBodyVO[] getBodys() { return getChildrenVO(); }



  
  public ICBillBodyVO[] getChildrenVO() { return (ICBillBodyVO[])super.getChildrenVO(); }
 

  
  public ICBillHeadVO getHead() { return getParentVO(); }

  
  public ICLocationVO[] getLocationVOs() {
    ICBillBodyVO[] bodys = getBodys();
    if (bodys == null || bodys.length <= 0) {
      return null;
    }
    List<ICLocationVO> locvolist = new ArrayList<ICLocationVO>();
    for (ICBillBodyVO body : bodys) {
      CollectionUtils.addArrayToList(locvolist, body.getLocationVOs());
    }
    if (locvolist.size() <= 0) {
      return null;
    }
    return (ICLocationVO[])locvolist.toArray(new ICLocationVO[locvolist.size()]);
  }


  
  public ICBillHeadVO getParentVO() { return (ICBillHeadVO)super.getParentVO(); }


  
  public String getTempBillPK() { return this.pk_billtemp; }





  
  public boolean isHasLoadedLocations() { return this.hasLoadedLocations; }





  
  public void setHasLoadedLocations(boolean hasLoadedLocations) { this.hasLoadedLocations = hasLoadedLocations; }


  
  public void setTempBillPK(String pk) { this.pk_billtemp = pk; }
}